package com.jb.charts;

import com.jb.web.application.WebService;
import com.jb.web.context.WebContext;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

//this service is called by JBServlet
//
public class ChartService implements WebService {
    public void process(WebContext ctx){
        HttpServletRequest request = ctx.getRequest();
        HttpServletResponse response = ctx.getResponse();
        String id = request.getParameter("clientId");
        ChartImpl chart = (ChartImpl) ctx.getPage().getDescendantByClientId(id);
        if(chart!=null)
            chart.generate(response);
    }
}
